package app.kotlin_1.adapter

import android.content.Context
import android.view.View
import app.kotlin_1.base.BaseRecyclerViewAdapter
import app.kotlin_1.base.BaseViewHolder
import app.kotlin_1.bean.TipsBean
import app.kotlin_1.utils.e
import  kotlinx.android.synthetic.main.item_game_detail_tips.view.*

/**
 * Created by 刘智强 on 2017/9/28.
 * 游戏详情的标签适配器
 */
class GameDetailTipsAdapter : BaseRecyclerViewAdapter<TipsBean> {
    private var context: Context? = null
    private var tipsBeanList = mutableListOf<TipsBean>()

    constructor(context: Context?, datas: MutableList<TipsBean>, layoutId: Int?) : super(context, datas, layoutId) {
        this.context = context
        this.tipsBeanList = datas
    }


    override fun bindData(viewHolder: BaseViewHolder, data: TipsBean, position: Int) {

        rootView?.ivHeadIcon?.setImageResource(data?.icon)
        rootView?.tvContent?.text = data?.title
        if (position == 0) {
            rootView?.tvName?.visibility = View.VISIBLE
            rootView?.tvName?.text = data.name
        } else {
            rootView?.tvName?.visibility = View.GONE
        }
        context?.e(data.title)

    }


}